<?php 
require_once('../class/localtion.php');
require_once('../class/upload.php');

if($_POST['projectname'] != "" && $_POST['localtionname'] != "" )
{
	$clslocal = new localtionpz();
	
	$adddata = $clslocal->addnewlocaltion("'{$_POST['projectname']}','{$_POST['localtionname']}','{$_POST['dbname']}'");
	
	
	if(!$adddata)
	{
		echo "<script>alert('Add Fail')</script>";
	}else
	{
		echo "<script>alert('Add Finish')</script>";
		
		if($_POST['dbname'] !="" ){
			
			
			$clslocal->data($_POST['dbname']);
			 echo "<meta http-equiv='refresh' content='0;URL=piezometer.php'>";
			
			}else{
				 echo "<meta http-equiv='refresh' content='0;URL=piezometer.php'>";		
			}
		
		
		}
}


?>
<form action="add_localtion.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="addok" value="1"/>

<table>
<tr>
<td>Project :</td>
<td><input name="projectname" type="text" /> <td>
</tr>
<tr>
<td>Location :</td>
<td><input name="localtionname" type="text" /> <td>
</tr>

<tr>
<td>DataBaseName :</td>
<td><input name="dbname" type="text" /> <td>
</tr>


<tr>
<td>CSV :</td>
<td><input name="filecsv" type="file" /> <td>
</tr>

<tr>
<td colspan="2" align="center"> <input name="Submit" type="submit" value="Submit" /> <td>
</tr>


</table>
